-
-
Notifications
You must be signed in to change notification settings - Fork 85
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add option to generate a presigned url with a expiration time #117
Add option to generate a presigned url with a expiration time #117
Conversation
Signed-off-by: Daniel San <[email protected]>
Danger run resulted in 1 warning; to find out more, see the checks page. Generated by 🚫 dangerJS |
Signed-off-by: Daniel San <[email protected]>
Signed-off-by: Daniel San <[email protected]>
3fb8650
to
ea46045
Compare
Signed-off-by: Daniel San <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks good to me. @mtrezza any additional comment?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some minor requests.
Also, can you please add test cases?
Signed-off-by: Daniel San <[email protected]>
Signed-off-by: Daniel San <[email protected]>
Signed-off-by: Daniel San <[email protected]>
Signed-off-by: Daniel San <[email protected]>
Signed-off-by: Daniel San <[email protected]>
Signed-off-by: Daniel San <[email protected]>
Signed-off-by: Daniel San <[email protected]>
@mtrezza I did 2 tests 😉 . |
Hello people. Let me know if I need to do anything else so that you can merge this PR. |
I think we can merge. @mtrezza do you think it is good now? |
Just my comment on the parameters table thread. |
I have added the parameter to the table and and improved the descriptions. Now I wonder if we should add an additional test that ensures that the presigned URL only presigns for a What's your opinion on that? |
This can really be a problem. I tried to generate a URL without passing a key in the hope of gaining access to the entire bucket, but the AWS SDK throws an exception. I also tried to put only one prefix as a key to try to access an entire "folder" from within the bucket, but when I open the URL the answer is that the key does not exist. So, in case you read the bucket or folder, I don't see it as a problem. Now for the case of writing to a file (or overwriting, via That said, I may be mistaken, but I only see 2 "options" (that can be done together):
They are just suggestions, let me know if something really needs to be done or if we should make my suggestions or if you have any other ideas? |
My two concerns are:
To address this I suggest to:
|
Hello. Could you add the comment to the code? Regarding the test, let me know if this test is enough for you: danielsanfr@8266a66 . If so, I'll make the |
The operation check should be a separate test case with a description that explains specifically what it is testing, to give this more significance. Also, can you spy on a method within the S3 adapter and just call through or mock it? The comment can just be a simple one that explains why the operation is specified and removing it can provide broad access to the S3 bucket, maybe with a like to the AWS S3 docs security section where this is explained. |
Signed-off-by: Daniel San <[email protected]>
…peration in the getSignedUrl function Signed-off-by: Daniel San <[email protected]>
Signed-off-by: Daniel San <[email protected]>
8edfec0
to
0873698
Compare
Hello guys. I hope everyone is okay. @mtrezza, I separated the test for the operation used and added the comment about security concerns in the code. I don't know how to "spy" on a method inside the S3 library, and I sincerely believe that it is not necessary. I wonder if you can approve this PR or we still need to make more changes? |
@danielsanfr Apologies for the long wait time, I have overlooked this in my notifications. |
directAccess: true, | ||
bucketPrefix: 'foo/bar/', | ||
baseUrl: 'http://example.com/files', | ||
['http://example.com/files', () => 'http://example.com/files'].forEach((baseUrl) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please refactor this for simplicity. We normally do not use such a pattern anywhere where we wrap a whole list of tests into a forEach
, so this may cause confusion or test execution issues, e.g. with test randomization.
Then this should be good to merge.
@danielsanfr I have been using this branch on my project, and it's working well. Thanks for your efforts!! |
@danielsanfr Could you address the open questions so we can merge this? I think there is just some minor refactoring left. |
@danielsanfr @dblythy Could anyone do this minor refactor? Then we can merge this feature and make is available officially. And the PR needs a rebase I think. |
any updates on this? we really need this since its an important security feature for file downloads. |
Would you want to create a new PR based on this PR and address the changes mentioned above? |
Just opened a PR here #180. I branched off this and refactored the one test you mentioned, let me know if i need to change anything else to get this through 👍 |
Hello people.
This PR solves the issue: #78
Let me know if everything is right or I need to do something else to accept this PR.
Unfortunately I can't test at DigitalOcean Spaces.